package kin.controller.system;

import java.util.LinkedHashMap;

import javax.servlet.http.HttpServletRequest;


import kin.bean.system.Form;

import kin.system.util.JsonBuildClassAttribute;
import kin.system.util.StringUtil;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;


public class JsonController extends BaseController{

	@ResponseBody
	@RequestMapping(value="/{className}/add",method=RequestMethod.GET)
    public Object add(HttpServletRequest request,@PathVariable String className){
		String str=null;
		LinkedHashMap<String, Object> whe=new LinkedHashMap<String, Object>();
		
    	whe.put("form_name",StringUtil.fristLetterUpperCase(className));
    	Form ff;
    	 this.setFormName("couple");
		try {
			ff = (Form)this.getFormServiceManager().find( whe, null,null);
			
			
			str = JsonBuildClassAttribute.getColumn(ff);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		   
		return this.getResult();
    	
    }
	
}
